From 7fdcd749635d0d7fd53aa6a3d8bb62980d4a7610 Mon Sep 17 00:00:00 2001 From: xftroxgpx Date: Tue, 18 Jul 2017 14:32:18 +0200 Subject: [PATCH] quoting library and benchmark names in warning --- src/cargo/util/toml/targets.rs | 4 ++-- tests/bench.rs | 2 +- tests/build.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo/util/toml/targets.rs b/src/cargo/util/toml/targets.rs index 9cd5ed5ff..498bb6637 100644 --- a/src/cargo/util/toml/targets.rs +++ b/src/cargo/util/toml/targets.rs @@ -110,7 +110,7 @@ fn clean_lib(toml_lib: Option<&TomlLibTarget>, .unwrap_or(&legacy_path); warnings.push(format!( - "path `{}` was erroneously implicitly accepted for library {},\n\ + "path `{}` was erroneously implicitly accepted for library `{}`,\n\ please rename the file to `src/lib.rs` or set lib.path in Cargo.toml", short_path.display(), lib.name() )); @@ -272,7 +272,7 @@ fn clean_benches(toml_benches: Option<&Vec>, .unwrap_or(&legacy_path); warnings.push(format!( - "path `{}` was erroneously implicitly accepted for benchmark {},\n\ + "path `{}` was erroneously implicitly accepted for benchmark `{}`,\n\ please set bench.path in Cargo.toml", short_path.display(), bench.name() )); diff --git a/tests/bench.rs b/tests/bench.rs index 2fbbd1f99..094bcb3d7 100644 --- a/tests/bench.rs +++ b/tests/bench.rs @@ -1186,6 +1186,6 @@ fn legacy_bench_name() { "#); assert_that(p.cargo_process("bench"), execs().with_status(0).with_stderr_contains("\ -[WARNING] path `src[/]bench.rs` was erroneously implicitly accepted for benchmark bench, +[WARNING] path `src[/]bench.rs` was erroneously implicitly accepted for benchmark `bench`, please set bench.path in Cargo.toml")); } diff --git a/tests/build.rs b/tests/build.rs index c94f5c56b..d56c70073 100644 --- a/tests/build.rs +++ b/tests/build.rs @@ -1047,7 +1047,7 @@ fn many_crate_types_old_style_lib_location() { pub fn foo() {} "#); assert_that(p.cargo_process("build"), execs().with_status(0).with_stderr_contains("\ -[WARNING] path `src[/]foo.rs` was erroneously implicitly accepted for library foo, +[WARNING] path `src[/]foo.rs` was erroneously implicitly accepted for library `foo`, please rename the file to `src/lib.rs` or set lib.path in Cargo.toml")); assert_that(&p.root().join("target/debug/libfoo.rlib"), existing_file()); -- 2.30.2